home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / info / xemacs.info-4 < prev    next >
Encoding:
GNU Info File  |  1995-09-01  |  49.1 KB  |  1,245 lines

  1. This is Info file ../../info/xemacs.info, produced by Makeinfo-1.63
  2. from the input file xemacs.texi.
  3.  
  4.    This file documents the XEmacs editor.
  5.  
  6.    Copyright (C) 1985, 1986, 1988 Richard M. Stallman.  Copyright (C)
  7. 1991, 1992, 1993, 1994 Lucid, Inc.  Copyright (C) 1993, 1994 Sun
  8. Microsystems, Inc.  Copyright (C) 1995 Amdahl Corporation.
  9.  
  10.    Permission is granted to make and distribute verbatim copies of this
  11. manual provided the copyright notice and this permission notice are
  12. preserved on all copies.
  13.  
  14.    Permission is granted to copy and distribute modified versions of
  15. this manual under the conditions for verbatim copying, provided also
  16. that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
  17. General Public License" are included exactly as in the original, and
  18. provided that the entire resulting derived work is distributed under the
  19. terms of a permission notice identical to this one.
  20.  
  21.    Permission is granted to copy and distribute translations of this
  22. manual into another language, under the above conditions for modified
  23. versions, except that the sections entitled "The GNU Manifesto",
  24. "Distribution" and "GNU General Public License" may be included in a
  25. translation approved by the author instead of in the original English.
  26.  
  27. 
  28. File: xemacs.info,  Node: M-x,  Next: Help,  Prev: Minibuffer,  Up: Top
  29.  
  30. Running Commands by Name
  31. ************************
  32.  
  33.    The Emacs commands that are used often or that must be quick to type
  34. are bound to keys--short sequences of characters--for convenient use.
  35. Other Emacs commands that are used more rarely are not bound to keys;
  36. to run them, you must refer to them by name.
  37.  
  38.    A command name consists, by convention, of one or more words,
  39. separated by hyphens: for example, `auto-fill-mode' or `manual-entry'.
  40. The use of English words makes the command name easier to remember than
  41. a key made up of obscure characters, even though it results in more
  42. characters to type.  You can run any command by name, even if it can be
  43. run by keys as well.
  44.  
  45.    To run a command by name, start with `M-x', then type the command
  46. name, and finish with RET.  `M-x' uses the minibuffer to read the
  47. command name.  RET exits the minibuffer and runs the command.
  48.  
  49.    Emacs uses the minibuffer for reading input for many different
  50. purposes; on this occasion, the string `M-x' is displayed at the
  51. beginning of the minibuffer as a "prompt" to remind you that your input
  52. should be the name of a command to be run.  *Note Minibuffer::, for
  53. full information on the features of the minibuffer.
  54.  
  55.    You can use completion to enter a command name.  For example, to
  56. invoke the command `forward-char', type:
  57.  
  58.      M-x forward-char RET
  59.    or
  60.      M-x fo TAB c RET
  61.  
  62. After you type in `M-x fo TAB' emacs will give you a possible list of
  63. completions from which you can choose. Note that `forward-char' is the
  64. same command that you invoke with the key `C-f'.  You can call any
  65. command (interactively callable function) defined in Emacs by its name
  66. using `M-x' regardless of whether or not any keys are bound to it.
  67.  
  68.    If you type `C-g' while Emacs reads the command name, you cancel the
  69. `M-x' command and get out of the minibuffer, ending up at top level.
  70.  
  71.    To pass a numeric argument to a command you are invoking with `M-x',
  72. specify the numeric argument before the `M-x'.  `M-x' passes the
  73. argument along to the function that it calls.  The argument value
  74. appears in the prompt while the command name is being read.
  75.  
  76.    You can use the command `M-x interactive' to specify a way of
  77. parsing arguments for interactive use of a function.  For example,
  78. write:
  79.  
  80.        (defun foo (arg) "Doc string" (interactive "p") ...use arg...)
  81.  
  82.    to make `arg' be the prefix argument when `foo' is called as a
  83. command.  The call to `interactive' is actually a declaration rather
  84. than a function; it tells `call-interactively' how to read arguments to
  85. pass to the function.  When actually called, `interactive' returns
  86. `nil'.
  87.  
  88.    The argument of INTERACTIVE is usually a string containing a code
  89. letter followed by a prompt.  Some code letters do not use I/O to get
  90. the argument and do not need prompts.  To prompt for multiple arguments,
  91. you must provide a code letter, its prompt, a newline, and another code
  92. letter, and so forth.  If the argument is not a string, it is evaluated
  93. to get a list of arguments to pass to the function.  If you do not
  94. provide an argument to `interactive', no arguments are passed when
  95. calling interactively.
  96.  
  97.    Available code letters are:
  98.  
  99. `a'
  100.      Function name: symbol with a function definition
  101.  
  102. `b'
  103.      Name of existing buffer
  104.  
  105. `B'
  106.      Name of buffer, possibly nonexistent
  107.  
  108. `c'
  109.      Character
  110.  
  111. `C'
  112.      Command name: symbol with interactive function definition
  113.  
  114. `d'
  115.      Value of point as number (does not do I/O)
  116.  
  117. `D'
  118.      Directory name
  119.  
  120. `e'
  121.      Last mouse event
  122.  
  123. `f'
  124.      Existing file name
  125.  
  126. `F'
  127.      Possibly nonexistent file name
  128.  
  129. `k'
  130.      Key sequence (string)
  131.  
  132. `m'
  133.      Value of mark as number (does not do I/O)
  134.  
  135. `n'
  136.      Number read using minibuffer
  137.  
  138. `N'
  139.      Prefix arg converted to number, or if none, do like code `n'
  140.  
  141. `p'
  142.      Prefix arg converted to number (does not do I/O)
  143.  
  144. `P'
  145.      Prefix arg in raw form (does not do I/O)
  146.  
  147. `r'
  148.      Region: point and mark as two numeric arguments, smallest first
  149.      (does not do I/O)
  150.  
  151. `s'
  152.      Any string
  153.  
  154. `S'
  155.      Any symbol
  156.  
  157. `v'
  158.      Variable name: symbol that is `user-variable-p'
  159.  
  160. `x'
  161.      Lisp expression read but not evaluated
  162.  
  163. `X'
  164.      Lisp expression read and evaluated
  165.  
  166.    In addition, if the string begins with `*', an error is signaled if
  167. the buffer is read-only.  This happens before reading any arguments.
  168. If the string begins with `@', the window the mouse is over is selected
  169. before anything else is done.  You may use both `@' and `*'; they are
  170. processed in the order that they appear.
  171.  
  172.    Normally, when describing a command that is run by name, we omit the
  173. RET that is needed to terminate the name.  Thus we may refer to `M-x
  174. auto-fill-mode' rather than `M-x auto-fill-mode' RET.  We mention the
  175. RET only when it it necessary to emphasize its presence, for example,
  176. when describing a sequence of input that contains a command name and
  177. arguments that follow it.
  178.  
  179.    `M-x' is defined to run the command `execute-extended-command',
  180. which is responsible for reading the name of another command and
  181. invoking it.
  182.  
  183. 
  184. File: xemacs.info,  Node: Help,  Next: Mark,  Prev: M-x,  Up: Top
  185.  
  186. Help
  187. ****
  188.  
  189.    Emacs provides extensive help features which revolve around a single
  190. character, `C-h'.  `C-h' is a prefix key that is used only for
  191. documentation-printing commands.  The characters you can type after
  192. `C-h' are called "help options".  One help option is `C-h'; you use it
  193. to ask for help about using `C-h'.
  194.  
  195.    `C-h C-h' prints a list of the possible help options, and then asks
  196. you to type the desired option.  It prompts with the string:
  197.  
  198.      A, B, C, F, I, K, L, M, N, S, T, V, W, C-c, C-d, C-n, C-w or C-h for more help:
  199.  
  200. You should type one of those characters.
  201.  
  202.    Typing a third `C-h' displays a description of what the options mean;
  203. Emacs still waits for you to type an option.  To cancel, type `C-g'.
  204.  
  205.    Here is a summary of the defined help commands.
  206.  
  207. `C-h a STRING RET'
  208.      Display a list of commands whose names contain STRING (`command-
  209.      apropos').
  210.  
  211. `C-h b'
  212.      Display a table of all key bindings currently in effect, with
  213.      local bindings of the current major mode first, followed by all
  214.      global bindings (`describe-bindings').
  215.  
  216. `C-h c KEY'
  217.      Print the name of the command that KEY runs (`describe-key-
  218.      briefly').  `c' is for `character'.  For more extensive
  219.      information on KEY, use `C-h k'.
  220.  
  221. `C-h f FUNCTION RET'
  222.      Display documentation on the Lisp function named FUNCTION
  223.      (`describe-function').  Note that commands are Lisp functions, so
  224.      a command name may be used.
  225.  
  226. `C-h i'
  227.      Run Info, the program for browsing documentation files (`info').
  228.      The complete Emacs manual is available online in Info.
  229.  
  230. `C-h k KEY'
  231.      Display name and documentation of the command KEY runs
  232.      (`describe-key').
  233.  
  234. `C-h l'
  235.      Display a description of the last 100 characters you typed
  236.      (`view-lossage').
  237.  
  238. `C-h m'
  239.      Display documentation of the current major mode (`describe-mode').
  240.  
  241. `C-h n'
  242.      Display documentation of Emacs changes, most recent first
  243.      (`view-emacs-news').
  244.  
  245. `C-h p'
  246.      Display a table of all mouse bindings currently in effect now, with
  247.      local bindings of the current major mode first, followed by all
  248.      global bindings (`describe-pointer').
  249.  
  250. `C-h s'
  251.      Display current contents of the syntax table, plus an explanation
  252.      of what they mean (`describe-syntax').
  253.  
  254. `C-h t'
  255.      Display the Emacs tutorial (`help-with-tutorial').
  256.  
  257. `C-h v VAR RET'
  258.      Display the documentation of the Lisp variable VAR (`describe-
  259.      variable').
  260.  
  261. `C-h w COMMAND RET'
  262.      Print which keys run the command named COMMAND (`where-is').
  263.  
  264. `M-x apropos REGEXP'
  265.      Show all symbols whose names contain matches for REGEXP.
  266.  
  267. Documentation for a Key
  268. =======================
  269.  
  270.    The most basic `C-h' options are `C-h c' (`describe-key-briefly')
  271. and `C-h k'
  272. (`describe-key').  `C-h c KEY' prints the name of the command that KEY
  273. is bound to in the echo area.  For example, `C-h c C-f' prints
  274. `forward-char'.  Since command names are chosen to describe what the
  275. command does, using this option is a good way to get a somewhat cryptic
  276. description of what KEY does.
  277.  
  278.    `C-h k KEY' is similar to `C-h c' but gives more information.  It
  279. displays the documentation string of the function KEY is bound to as
  280. well as its name.  KEY is a string or vector of events.  When called
  281. interactively, KEY may also be a menu selection.  This information does
  282. not usually fit into the echo area, so a window is used for the display.
  283.  
  284. Help by Command or Variable Name
  285. ================================
  286.  
  287.    `C-h f' (`describe-function') reads the name of a Lisp function
  288. using the minibuffer, then displays that function's documentation
  289. string in a window.  Since commands are Lisp functions, you can use the
  290. argument FUNCTION to get the documentation of a command that you know
  291. by name.  For example,
  292.  
  293.      C-h f auto-fill-mode RET
  294.  
  295. displays the documentation for `auto-fill-mode'. Using `C-h f' is the
  296. only way to see the documentation of a command that is not bound to any
  297. key, that is, a command you would normally call using `M-x'.  If the
  298. variable `describe-function-show-arglist' is `t', `describe-function'
  299. shows its arglist if the FUNCTION is not an autoload function.
  300.  
  301.    `C-h f' is also useful for Lisp functions you are planning to use in
  302. a Lisp program.  For example, if you have just written the code
  303. `(make-vector len)' and want to make sure you are using `make-vector'
  304. properly, type `C-h f make-vector RET'.  Because `C-h f' allows all
  305. function names, not just command names, you may find that some of your
  306. favorite abbreviations that work in `M-x' don't work in `C-h f'.  An
  307. abbreviation may be unique among command names, yet fail to be unique
  308. when other function names are allowed.
  309.  
  310.    If you type RET, leaving the minibuffer empty, `C-h f' by default
  311. describes the function called by the innermost Lisp expression in the
  312. buffer around point, provided that that is a valid, defined Lisp
  313. function name.  For example, if point is located following the text
  314. `(make-vector (car x)', the innermost list containing point is the one
  315. starting with `(make-vector', so the default is to describe the
  316. function `make-vector'.
  317.  
  318.    `C-h f' is often useful just to verify that you have the right
  319. spelling for the function name.  If `C-h f' mentions a default in the
  320. prompt, you have typed the name of a defined Lisp function.  If that is
  321. what you wanted to know, just type `C-g' to cancel the `C-h f' command
  322. and continue editing.
  323.  
  324.    `C-h w COMMAND RET' (`where-s') tells you what keys are bound to
  325. COMMAND.  It prints a list of the keys in the echo area. Alternatively,
  326. it informs you that a command is not bound to any keys, which implies
  327. that you must use `M-x' to call the command.
  328.  
  329.    `C-h v' (`describe-variable') is like `C-h f' but describes Lisp
  330. variables instead of Lisp functions.  Its default is the Lisp symbol
  331. around or before point, if that is the name of a known Lisp variable.
  332. *Note Variables::.
  333.  
  334. Apropos
  335. =======
  336.  
  337. `C-h a'
  338.      Show only symbols that are names of commands (`command-apropos').
  339.  
  340. `M-x apropos REGEXP'
  341.      Show all symbols whose names comtain matches for REGEXP.
  342.  
  343.    It is possible to ask a question like, "What are the commands for
  344. working with files?"  To do this, type `C-h a file RET', which displays
  345. a list of all command names that contain `file', such as `copy-file',
  346. `find-file', and so on.  With each command name a brief description of
  347. its use and information on the keys you can use to invoke it is
  348. displayed.  For example, you would be informed that you can invoke
  349. `find-file' by typing `C-x C-f'.  The `a' in `C-h a' stands for
  350. `Apropos'; `C-h a' runs the Lisp function `command-apropos'.
  351.  
  352.    Because `C-h a' looks only for functions whose names contain the
  353. string you specify, you must use ingenuity in choosing the string.  If
  354. you are looking for commands for killing backwards and `C-h a
  355. kill-backwards RET' doesn't reveal any commands, don't give up.  Try
  356. just `kill', or just `backwards', or just `back'.  Be persistent.
  357. Pretend you are playing Adventure.  Also note that you can use a
  358. regular expression as the argument (*note Regexps::.).
  359.  
  360.    Here is a set of arguments to give to `C-h a' that covers many
  361. classes of Emacs commands, since there are strong conventions for naming
  362. standard Emacs commands.  By giving you a feeling for the naming
  363. conventions, this set of arguments can also help you develop a
  364. technique for picking `apropos' strings.
  365.  
  366.      char, line, word, sentence, paragraph, region, page, sexp, list,
  367.      defun, buffer, frame, window, file, dir, register, mode,
  368.      beginning, end, forward, backward, next, previous, up, down,
  369.      search, goto, kill, delete, mark, insert, yank, fill, indent, case,
  370.      change, set, what, list, find, view, describe.
  371.  
  372.    To list all Lisp symbols that contain a match for a regexp, not just
  373. the ones that are defined as commands, use the command `M-x apropos'
  374. instead of `C-h a'.
  375.  
  376. Other Help Commands
  377. ===================
  378.  
  379.    `C-h i' (`info') runs the Info program, which is used for browsing
  380. through structured documentation files.  The entire Emacs manual is
  381. available within Info.  Eventually all the documentation of the GNU
  382. system will be available.  Type `h' after entering Info to run a
  383. tutorial on using Info.
  384.  
  385.    If something surprising happens, and you are not sure what commands
  386. you typed, use `C-h l' (`view-lossage').  `C-h l' prints the last 100
  387. command characters you typed.  If you see commands you don't know, use
  388. `C-h c' to find out what they do.
  389.  
  390.    Emacs has several major modes. Each mode redefines a few keys and
  391. makes a few other changes in how editing works.  `C-h m'
  392. (`describe-mode') prints documentation on the current major mode, which
  393. normally describes all the commands that are changed in this mode.
  394.  
  395.    `C-h b' (`describe-bindings') and `C-h s' (`describe-syntax')
  396. present information about the current Emacs mode that is not covered by
  397. `C-h m'.  `C-h b' displays a list of all key bindings currently in
  398. effect, with the local bindings of the current major mode first,
  399. followed by the global bindings (*note Key Bindings::.).  `C-h s'
  400. displays the contents of the syntax table with explanations of each
  401. character's syntax (*note Syntax::.).
  402.  
  403.    The other `C-h' options display various files of useful information.
  404. `C-h C-w' (`describe-no-warranty') displays details on the complete
  405. absence of warranty for XEmacs.  `C-h n' (`view-emacs-news') displays
  406. the file `emacs/etc/NEWS', which contains documentation on Emacs
  407. changes arranged chronologically.  `C-h t' (`help-with-tutorial')
  408. displays the learn-by-doing Emacs tutorial. `C-h C-c'
  409. (`describe-copying') displays the file `emacs/etc/COPYING', which tells
  410. you the conditions you must obey in distributing copies of Emacs.  `C-h
  411. C-d' (`describe-distribution') displays another file named
  412. `emacs/etc/DISTRIB', which tells you how you can order a copy of the
  413. latest version of Emacs.
  414.  
  415. 
  416. File: xemacs.info,  Node: Mark,  Next: Mouse Selection,  Prev: Help,  Up: Top
  417.  
  418. Selecting Text
  419. **************
  420.  
  421.    Many Emacs commands operate on an arbitrary contiguous part of the
  422. current buffer. You can select text in two ways:
  423.  
  424.    * You use special keys to select text by defining a region between
  425.      point and the mark.
  426.  
  427.    * If you are running XEmacs under X, you can also select text with
  428.      the mouse.
  429.  
  430. The Mark and the Region
  431. =======================
  432.  
  433.    To specify the text for a command to operate on, set "the mark" at
  434. one end of it, and move point to the other end.  The text between point
  435. and the mark is called "the region".  You can move point or the mark to
  436. adjust the boundaries of the region.  It doesn't matter which one is
  437. set first chronologically, or which one comes earlier in the text.
  438.  
  439.    Once the mark has been set, it remains until it is set again at
  440. another place.  The mark remains fixed with respect to the preceding
  441. character if text is inserted or deleted in a buffer.  Each Emacs
  442. buffer has its own mark; when you return to a buffer that had been
  443. selected previously, it has the same mark it had before.
  444.  
  445.    Many commands that insert text, such as `C-y' (`yank') and `M-x
  446. insert-buffer', position the mark at one end of the inserted text--the
  447. opposite end from where point is positioned, so that the region
  448. contains the text just inserted.
  449.  
  450.    Aside from delimiting the region, the mark is useful for marking a
  451. spot that you may want to go back to.  To make this feature more useful,
  452. Emacs remembers 16 previous locations of the mark in the `mark ring'.
  453.  
  454. * Menu:
  455.  
  456. * Setting Mark::    Commands to set the mark.
  457. * Using Region::    Summary of ways to operate on contents of the region.
  458. * Marking Objects::    Commands to put region around textual units.
  459. * Mark Ring::       Previous mark positions saved so you can go back there.
  460.  
  461. 
  462. File: xemacs.info,  Node: Setting Mark,  Next: Using Region,  Prev: Mark,  Up: Mark
  463.  
  464. Setting the Mark
  465. ----------------
  466.  
  467.    Here are some commands for setting the mark:
  468.  
  469. `C-SPC'
  470.      Set the mark where point is (`set-mark-command').
  471.  
  472. `C-@'
  473.      The same.
  474.  
  475. `C-x C-x'
  476.      Interchange mark and point (`exchange-point-and-mark').
  477.  
  478. `C-<'
  479.      Pushes a mark at the beginning of the buffer.
  480.  
  481. `C->'
  482.      Pushes a mark at the end of the buffer.
  483.  
  484.    For example, to convert part of the buffer to all upper-case, you
  485. can use the `C-x C-u' (`upcase-region') command, which operates on the
  486. text in the region.  First go to the beginning of the text you want to
  487. capitalize and type `C-SPC' to put the mark there, then move to the
  488. end, and then type `C-x C-u' to capitalize the selected region.  You
  489. can also set the mark at the end of the text, move to the beginning,
  490. and then type `C-x C-u'.  Most commands that operate on the text in the
  491. region have the word `region' in their names.
  492.  
  493.    The most common way to set the mark is with the `C-SPC' command
  494. (`set-mark-command').  This command sets the mark where point is. You
  495. can then move point away, leaving the mark behind.  It is actually
  496. incorrect to speak of the character `C-SPC'; there is no such
  497. character.  When you type SPC while holding down CTRL, you get the
  498. character `C-@' on most terminals. This character is actually bound to
  499. `set-mark-command'.  But unless you are unlucky enough to have a
  500. terminal where typing `C-SPC' does not produce `C-@', you should think
  501. of this character as `C-SPC'.
  502.  
  503.    Since terminals have only one cursor, Emacs cannot show you where the
  504. mark is located. Most people use the mark soon after they set it, before
  505. they forget where it is. But you can see where the mark is with the
  506. command `C-x C-x' (`exchange-point-and-mark') which puts the mark where
  507. point was and point where the mark was.  The extent of the region is
  508. unchanged, but the cursor and point are now at the previous location of
  509. the mark.
  510.  
  511.    Another way to set the mark is to push the mark to the beginning of a
  512. buffer while leaving point at its original location. If you supply an
  513. argument to `C-<' (`mark-beginning-of-buffer'), the mark is pushed N/10
  514. of the way from the true beginning of the buffer. You can also set the
  515. mark at the end of a buffer with `C->' (`mark-end-of-buffer'). It
  516. pushes the mark to the end of the buffer, leaving point alone.
  517. Supplying an argument to the command pushes the mark N/10 of the way
  518. from the true end of the buffer.
  519.  
  520.    If you are using XEmacs under the X window system, you can set the
  521. variable `zmacs-regions' to `t'. This makes the current region (defined
  522. by point and mark) highlight and makes it available as the X clipboard
  523. selection, which means you can use the menu bar items on it.  *Note
  524. Active Regions:: for more information.
  525.  
  526.    `C-x C-x' is also useful when you are satisfied with the location of
  527. point but want to move the mark; do `C-x C-x' to put point there and
  528. then you can move it.  A second use of `C-x C-x', if necessary, puts
  529. the mark at the new location with point back at its original location.
  530.  
  531. 
  532. File: xemacs.info,  Node: Using Region,  Next: Marking Objects,  Prev: Setting Mark,  Up: Mark
  533.  
  534. Operating on the Region
  535. -----------------------
  536.  
  537.    Once you have created an active region, you can do many things to
  538. the text in it:
  539.    * Kill it with `C-w' (*note Killing::.).
  540.  
  541.    * Save it in a register with `C-x r s' (*note Registers::.).
  542.  
  543.    * Save it in a buffer or a file (*note Accumulating Text::.).
  544.  
  545.    * Convert case with `C-x C-l' or `C-x C-u'
  546.      (*note Case::.).
  547.  
  548.    * Evaluate it as Lisp code with `M-x eval-region' (*note Lisp
  549.      Eval::.).
  550.  
  551.    * Fill it as text with `M-g' (*note Filling::.).
  552.  
  553.    * Print hardcopy with `M-x print-region' (*note Hardcopy::.).
  554.  
  555.    * Indent it with `C-x TAB' or `C-M-\' (*note Indentation::.).
  556.  
  557. 
  558. File: xemacs.info,  Node: Marking Objects,  Next: Mark Ring,  Prev: Using Region,  Up: Mark
  559.  
  560. Commands to Mark Textual Objects
  561. --------------------------------
  562.  
  563.    There are commands for placing point and the mark around a textual
  564. object such as a word, list, paragraph or page.
  565.  
  566. `M-@'
  567.      Set mark after end of next word (`mark-word').  This command and
  568.      the following one do not move point.
  569.  
  570. `C-M-@'
  571.      Set mark after end of next Lisp expression (`mark-sexp').
  572.  
  573. `M-h'
  574.      Put region around current paragraph (`mark-paragraph').
  575.  
  576. `C-M-h'
  577.      Put region around current Lisp defun (`mark-defun').
  578.  
  579. `C-x h'
  580.      Put region around entire buffer (`mark-whole-buffer').
  581.  
  582. `C-x C-p'
  583.      Put region around current page (`mark-page').
  584.  
  585.    `M-@' (`mark-word') puts the mark at the end of the next word, while
  586. `C-M-@' (`mark-sexp') puts it at the end of the next Lisp expression.
  587. These characters sometimes save you some typing.
  588.  
  589.    A number of commands are available that set both point and mark and
  590. thus delimit an object in the buffer.  `M-h' (`mark-paragraph') moves
  591. point to the beginning of the paragraph that surrounds or follows
  592. point, and puts the mark at the end of that paragraph (*note
  593. Paragraphs::.).  You can then indent, case-convert, or kill the whole
  594. paragraph.  In the same fashion, `C-M-h' (`mark-defun') puts point
  595. before and the mark after the current or following defun (*note
  596. Defuns::.).  `C-x C-p' (`mark-page') puts point before the current page
  597. (or the next or previous, depending on the argument), and mark at the
  598. end (*note Pages::.).  The mark goes after the terminating page
  599. delimiter (to include it), while point goes after the preceding page
  600. delimiter (to exclude it).  Finally, `C-x h' (`mark-whole-buffer') sets
  601. up the entire buffer as the region by putting point at the beginning
  602. and the mark at the end.
  603.  
  604. 
  605. File: xemacs.info,  Node: Mark Ring,  Prev: Marking Objects,  Up: Mark
  606.  
  607. The Mark Ring
  608. -------------
  609.  
  610.    Aside from delimiting the region, the mark is also useful for marking
  611. a spot that you may want to go back to.  To make this feature more
  612. useful, Emacs remembers 16 previous locations of the mark in the "mark
  613. ring".  Most commands that set the mark push the old mark onto this
  614. ring.  To return to a marked location, use `C-u C-SPC' (or `C-u C-@');
  615. this is the command `set-mark-command' given a numeric argument.  The
  616. command moves point to where the mark was, and restores the mark from
  617. the ring of former marks. Repeated use of this command moves point to
  618. all the old marks on the ring, one by one.  The marks you have seen go
  619. to the end of the ring, so no marks are lost.
  620.  
  621.    Each buffer has its own mark ring.  All editing commands use the
  622. current buffer's mark ring.  In particular, `C-u C-SPC' always stays in
  623. the same buffer.
  624.  
  625.    Many commands that can move long distances, such as `M-<'
  626. (`beginning-of-buffer'), start by setting the mark and saving the old
  627. mark on the mark ring.  This makes it easier for you to move back
  628. later.  Searches set the mark, unless they do not actually move point.
  629. When a command sets the mark, `Mark Set' is printed in the echo area.
  630.  
  631.    The variable `mark-ring-max' is the maximum number of entries to
  632. keep in the mark ring.  If that many entries exist and another entry is
  633. added, the last entry in the list is discarded.  Repeating `C-u C-SPC'
  634. circulates through the entries that are currently in the ring.
  635.  
  636.    The variable `mark-ring' holds the mark ring itself, as a list of
  637. marker objects in the order most recent first.  This variable is local
  638. in every buffer.
  639.  
  640. 
  641. File: xemacs.info,  Node: Mouse Selection,  Next: Additional Mouse Operations,  Prev: Mark,  Up: Top
  642.  
  643. Selecting Text with the Mouse
  644. =============================
  645.  
  646.    If you are using XEmacs under X, you can use the mouse cursor to
  647. select text.  There are two mouse cursor shapes:
  648.    * When the mouse cursor is over text, it appears as an I-beam, the
  649.      same cursor that `xterm' uses.
  650.  
  651.    * When the mouse cursor is not over text, it appears as a plus sign
  652.      (+).
  653.  
  654.    You can set the value of the variable `x-mode-pointer-shape' to
  655. determine the shape of the mouse pointer when it is over the mode line.
  656. If the value is `nil', either the variable `x-nontext-pointer-shape'
  657. or `x-pointer-shape' is used.
  658.  
  659.    If you want to get fancy, you can set the foreground and background
  660. colors of the mouse pointer with the variables
  661. `x-pointer-background-color' and `x-pointer-foreground-color'.
  662.  
  663.    There are two ways to select a region of text with the mouse:
  664.  
  665.    To select a word in text, double-click with the left mouse button
  666. while the mouse cursor is over the word.  The word is highlighted when
  667. selected. On monochrome monitors, a stippled background indicates that a
  668. region of text has been highlighted. On color monitors, a color
  669. background indicates highlighted text. You can triple-click to select
  670. whole lines.
  671.  
  672.    To select an arbitrary region of text:
  673.  
  674.   1. Move the mouse cursor over the character at the beginning of the
  675.      region of text you want to select.
  676.  
  677.   2. Press and hold the left mouse button.
  678.  
  679.   3. While holding the left mouse button down, drag the cursor to the
  680.      character at the end of the region of text you want to select.
  681.  
  682.   4. Release the left mouse button.
  683.         The selected region of text is highlighted.
  684.  
  685.    Once a region of text is selected, it becomes the primary X selection
  686. (*note Using X Selections::.) as well as the Emacs selected region. You
  687. can paste it into other X applications and use the options from the
  688. Edit pull-down menu on it.  Since it is also the Emacs region, you can
  689. use Emacs region commands on it.
  690.  
  691. 
  692. File: xemacs.info,  Node: Additional Mouse Operations,  Next: Killing,  Prev: Mouse Selection,  Up: Top
  693.  
  694. Additional Mouse Operations
  695. ===========================
  696.  
  697.    XEmacs also provides the following mouse functions.  Most of these
  698. are not bound to mouse gestures by default, but they are provided for
  699. your customization pleasure.  For example, if you wanted `shift-left'
  700. (that is, holding down the Shift key and clicking the left mouse
  701. button) to delete the character at which you are pointing, then you
  702. could do this:
  703.  
  704.      (global-set-key '(shift button1) 'mouse-del-char)
  705.  
  706. `mouse-del-char'
  707.      Delete the character pointed to by the mouse.
  708.  
  709. `mouse-delete-window'
  710.      Delete the Emacs window that the mouse is on.
  711.  
  712. `mouse-keep-one-window'
  713.      Select the Emacs window that the mouse is on, then delete all other
  714.      windows on this frame.
  715.  
  716. `mouse-kill-line'
  717.      Kill the line pointed to by the mouse.
  718.  
  719. `mouse-line-length'
  720.      Print the length of the line indicated by the pointer.
  721.  
  722. `mouse-scroll'
  723.      Scroll point to the mouse position.
  724.  
  725. `mouse-select'
  726.      Select the Emacs window the mouse is on.
  727.  
  728. `mouse-select-and-split'
  729.      Select the Emacs window mouse is on, then split it vertically in
  730.      half.
  731.  
  732. `mouse-set-mark'
  733.      Select the Emacs window the mouse is on and set the mark at the
  734.      mouse position.  Display the cursor at that position for a second.
  735.  
  736. `mouse-set-point'
  737.      Select the Emacs window that the mouse is on and move point to the
  738.      mouse position.
  739.  
  740. `mouse-track'
  741.      Make a selection with the mouse.   This is the default binding of
  742.      the left mouse button (button1).
  743.  
  744. `mouse-track-adjust'
  745.      Extend the existing selection.  This is the default binding of
  746.      Shift-button1.
  747.  
  748. `mouse-track-and-copy-to-cutbuffer'
  749.      Make a selection like `mouse-track', but also copy it to the cut
  750.      buffer.
  751.  
  752. `mouse-track-delete-and-insert'
  753.      Make a selection with the mouse and insert it at point.  This is
  754.      the default binding of control-shift-button1.
  755.  
  756. `mouse-track-insert'
  757.      Make a selection with the mouse and insert it at point.  This is
  758.      the default binding of control-button1.
  759.  
  760. `mouse-window-to-region'
  761.      Narrow a window to the region between the cursor and the mouse
  762.      pointer.
  763.  
  764.    The `M-x mouse-track' command should be bound to a mouse button.  If
  765. you click-and-drag, the selection is set to the region between the
  766. point of the initial click and the point at which you release the
  767. button.  These positions do not need to be ordered.
  768.  
  769.    If you click-and-release without moving the mouse, the point is
  770. moved, and the selection is disowned (there will be no selection
  771. owner.)  The mark will be set to the previous position of point.
  772.  
  773.    If you double-click, the selection will extend by symbols instead of
  774. by characters.  If you triple-click, the selection will extend by lines.
  775.  
  776.    If you drag the mouse off the top or bottom of the window, you can
  777. select pieces of text that are larger than the visible part of the
  778. buffer; the buffer will scroll as necessary.
  779.  
  780.    The selected text becomes the current X selection, and is also
  781. copied to the top of the kill ring.  Point will be left at the position
  782. at which you released the button and the mark will be left at the
  783. initial click position.  Bind a mouse click to
  784. `mouse-track-and-copy-to-cutbuffer' to copy selections to the cut
  785. buffer.  (See also the `mouse-track-adjust' command, on
  786. `Shift-button1'.)
  787.  
  788.    The `M-x mouse-track-adjust' command should be bound to a mouse
  789. button.  The selection will be enlarged or shrunk so that the point of
  790. the mouse click is one of its endpoints.  This is only meaningful after
  791. the `mouse-track' command (button1) has been executed.
  792.  
  793.    The `M-x mouse-track-delete-and-insert' command is exactly the same
  794. as the `mouse-track' command on button1, except that point is not
  795. moved; the selected text is immediately inserted after being selected;
  796. and the text of the selection is deleted.
  797.  
  798.    The `M-x mouse-track-insert' command is exactly the same as the
  799. `mouse-track' command on button1, except that point is not moved; the
  800. selected text is immediately inserted after being selected; and the
  801. selection is immediately disowned afterwards.
  802.  
  803. 
  804. File: xemacs.info,  Node: Killing,  Next: Yanking,  Prev: Additional Mouse Operations,  Up: Top
  805.  
  806. Deletion and Killing
  807. ====================
  808.  
  809.    Most commands that erase text from the buffer save it. You can get
  810. the text back if you change your mind, or you can move or copy it to
  811. other parts of the buffer.  Commands which erase text and save it in the
  812. kill ring are known as "kill" commands.  Some other commands erase text
  813. but do not save it; they are known as "delete" commands.  (This
  814. distinction is made only for erasing text in the buffer.)
  815.  
  816.    The commands' names and individual descriptions use the words `kill'
  817. and `delete' to indicate what they do.  If you perform a kill or delete
  818. command by mistake, use the `C-x u' (`undo') command to undo it (*note
  819. Undo::.). The delete commands include `C-d' (`delete-char') and DEL
  820. (`delete-backward-char'), which delete only one character at a time,
  821. and those commands that delete only spaces or newlines.  Commands that
  822. can destroy significant amounts of nontrivial data usually kill.
  823.  
  824. Deletion
  825. --------
  826.  
  827. `C-d'
  828.      Delete next character (`delete-char').
  829.  
  830. `DEL'
  831.      Delete previous character (`delete-backward-char').
  832.  
  833. `M-\'
  834.      Delete spaces and tabs around point (`delete-horizontal-space').
  835.  
  836. `M-SPC'
  837.      Delete spaces and tabs around point, leaving one space
  838.      (`just-one-space').
  839.  
  840. `C-x C-o'
  841.      Delete blank lines around the current line (`delete-blank-lines').
  842.  
  843. `M-^'
  844.      Join two lines by deleting the intervening newline, and any
  845.      indentation following it (`delete-indentation').
  846.  
  847.    The most basic delete commands are `C-d' (`delete-char') and DEL
  848. (`delete-backward-char').  `C-d' deletes the character after point, the
  849. one the cursor is "on top of".  Point doesn't move.  DEL deletes the
  850. character before the cursor, and moves point back.  You can delete
  851. newlines like any other characters in the buffer; deleting a newline
  852. joins two lines.  Actually, `C-d' and DEL aren't always delete
  853. commands; if you give them an argument, they kill instead, since they
  854. can erase more than one character this way.
  855.  
  856.    The other delete commands delete only formatting characters: spaces,
  857. tabs and newlines.  `M-\' (`delete-horizontal-space') deletes all
  858. spaces and tab characters before and after point.  `M-SPC'
  859. (`just-one-space') does the same but leaves a single space after point,
  860. regardless of the number of spaces that existed previously (even zero).
  861.  
  862.    `C-x C-o' (`delete-blank-lines') deletes all blank lines after the
  863. current line. If the current line is blank, it deletes all blank lines
  864. preceding the current line as well as leaving one blank line, the
  865. current line.  `M-^' (`delete-indentation') joins the current line and
  866. the previous line, or, if given an argument, joins the current line and
  867. the next line by deleting a newline and all surrounding spaces, possibly
  868. leaving a single space.  *Note M-^: Indentation.
  869.  
  870. Killing by Lines
  871. ----------------
  872.  
  873. `C-k'
  874.      Kill rest of line or one or more lines (`kill-line').
  875.  
  876.    The simplest kill command is `C-k'.  If given at the beginning of a
  877. line, it kills all the text on the line, leaving the line blank.  If
  878. given on a blank line, the blank line disappears.  As a consequence, a
  879. line disappears completely if you go to the front of a non-blank line
  880. and type `C-k' twice.
  881.  
  882.    More generally, `C-k' kills from point up to the end of the line,
  883. unless it is at the end of a line.  In that case, it kills the newline
  884. following the line, thus merging the next line into the current one.
  885. Emacs ignores invisible spaces and tabs at the end of the line when
  886. deciding which case applies: if point appears to be at the end of the
  887. line, you can be sure the newline will be killed.
  888.  
  889.    If you give `C-k' a positive argument, it kills that many lines and
  890. the newlines that follow them (however, text on the current line before
  891. point is not killed).  With a negative argument, `C-k' kills back to a
  892. number of line beginnings.  An argument of -2 means kill back to the
  893. second line beginning.  If point is at the beginning of a line, that
  894. line beginning doesn't count, so `C-u - 2 C-k' with point at the front
  895. of a line kills the two previous lines.
  896.  
  897.    `C-k' with an argument of zero kills all the text before point on the
  898. current line.
  899.  
  900. Other Kill Commands
  901. -------------------
  902.  
  903. `C-w'
  904.      Kill region (from point to the mark) (`kill-region').  *Note
  905.      Words::.
  906.  
  907. `M-d'
  908.      Kill word (`kill-word').
  909.  
  910. `M-DEL'
  911.      Kill word backwards (`backward-kill-word').
  912.  
  913. `C-x DEL'
  914.      Kill back to beginning of sentence (`backward-kill-sentence').
  915.      *Note Sentences::.
  916.  
  917. `M-k'
  918.      Kill to end of sentence (`kill-sentence').
  919.  
  920. `C-M-k'
  921.      Kill sexp (`kill-sexp').  *Note Lists::.
  922.  
  923. `M-z CHAR'
  924.      Kill up to next occurrence of CHAR (`zap-to-char').
  925.  
  926.    `C-w' (`kill-region') is a very general kill command; it kills
  927. everything between point and the mark. You can use this command to kill
  928. any contiguous sequence of characters by first setting the mark at one
  929. end of a sequence of characters, then going to the other end and typing
  930. `C-w'.
  931.  
  932.    A convenient way of killing is combined with searching: `M-z'
  933. (`zap-to-char') reads a character and kills from point up to (but not
  934. including) the next occurrence of that character in the buffer.  If
  935. there is no next occurrence, killing goes to the end of the buffer.  A
  936. numeric argument acts as a repeat count.  A negative argument means to
  937. search backward and kill text before point.
  938.  
  939.    Other syntactic units can be killed: words, with `M-DEL' and `M-d'
  940. (*note Words::.); sexps, with `C-M-k' (*note Lists::.); and sentences,
  941. with `C-x DEL' and `M-k' (*note Sentences::.).
  942.  
  943. 
  944. File: xemacs.info,  Node: Yanking,  Next: Using X Selections,  Prev: Killing,  Up: Top
  945.  
  946. Yanking
  947. =======
  948.  
  949.    "Yanking" means getting back text which was killed. Some systems
  950. call this "pasting".  The usual way to move or copy text is to kill it
  951. and then yank it one or more times.
  952.  
  953. `C-y'
  954.      Yank last killed text (`yank').
  955.  
  956. `M-y'
  957.      Replace re-inserted killed text with the previously killed text
  958.      (`yank-pop').
  959.  
  960. `M-w'
  961.      Save region as last killed text without actually killing it
  962.      (`copy-region-as-kill').
  963.  
  964. `C-M-w'
  965.      Append next kill to last batch of killed text (`append-next-kill').
  966.  
  967. * Menu:
  968.  
  969. * Kill Ring::       Where killed text is stored.  Basic yanking.
  970. * Appending Kills:: Several kills in a row all yank together.
  971. * Earlier Kills::   Yanking something killed some time ago.
  972.  
  973. 
  974. File: xemacs.info,  Node: Kill Ring,  Next: Appending Kills,  Prev: Yanking,  Up: Yanking
  975.  
  976. The Kill Ring
  977. -------------
  978.  
  979.    All killed text is recorded in the "kill ring", a list of blocks of
  980. text that have been killed.  There is only one kill ring, used in all
  981. buffers, so you can kill text in one buffer and yank it in another
  982. buffer.  This is the usual way to move text from one file to another.
  983. (*Note Accumulating Text::, for some other ways.)
  984.  
  985.    If you have two separate Emacs processes, you cannot use the kill
  986. ring to move text. If you are using XEmacs under X, however, you can
  987. use the X selection mechanism to move text from one to another.
  988.  
  989.    If you are using XEmacs under X and have one Emacs process with
  990. multiple frames, they do share the same kill ring.  You can kill or
  991. copy text in one Emacs frame, then yank it in the other frame belonging
  992. to the same process.
  993.  
  994.    The command `C-y' (`yank') reinserts the text of the most recent
  995. kill.  It leaves the cursor at the end of the text and sets the mark at
  996. the beginning of the text.  *Note Mark::.
  997.  
  998.    `C-u C-y' yanks the text, leaves the cursor in front of the text,
  999. and sets the mark after it, if the argument is with just a `C-u'.  Any
  1000. other argument, including `C-u' and digits, has different results,
  1001. described below, under "Yanking Earlier Kills".
  1002.  
  1003.    To copy a block of text, you can also use `M-w'
  1004. (`copy-region-as-kill'), which copies the region into the kill ring
  1005. without removing it from the buffer. `M-w' is similar to `C-w' followed
  1006. by `C-y' but does not mark the buffer as "modified" and does not
  1007. actually cut anything.
  1008.  
  1009. 
  1010. File: xemacs.info,  Node: Appending Kills,  Next: Earlier Kills,  Prev: Kill Ring,  Up: Yanking
  1011.  
  1012. Appending Kills
  1013. ---------------
  1014.  
  1015.    Normally, each kill command pushes a new block onto the kill ring.
  1016. However, two or more kill commands in a row combine their text into a
  1017. single entry, so that a single `C-y' yanks it all back. This means you
  1018. don't have to kill all the text you want to yank in one command; you
  1019. can kill line after line, or word after word, until you have killed what
  1020. you want, then get it all back at once using `C-y'. (Thus we join
  1021. television in leading people to kill thoughtlessly.)
  1022.  
  1023.    Commands that kill forward from point add onto the end of the
  1024. previous killed text.  Commands that kill backward from point add onto
  1025. the beginning.  This way, any sequence of mixed forward and backward
  1026. kill commands puts all the killed text into one entry without
  1027. rearrangement.  Numeric arguments do not break the sequence of
  1028. appending kills.  For example, suppose the buffer contains:
  1029.  
  1030.      This is the first
  1031.      line of sample text
  1032.      and here is the third.
  1033.  
  1034. with point at the beginning of the second line.  If you type `C-k C-u 2
  1035. M-DEL C-k', the first `C-k' kills the text `line of sample text', `C-u
  1036. 2 M-DEL' kills `the first' with the newline that followed it, and the
  1037. second `C-k' kills the newline after the second line.  The result is
  1038. that the buffer contains `This is and here is the third.' and a single
  1039. kill entry contains `the firstRETline of sample textRET'--all the
  1040. killed text, in its original order.
  1041.  
  1042.    If a kill command is separated from the last kill command by other
  1043. commands (not just numeric arguments), it starts a new entry on the kill
  1044. ring.  To force a kill command to append, first type the command `C-M-w'
  1045. (`append-next-kill'). `C-M-w' tells the following command, if it is a
  1046. kill command, to append the text it kills to the last killed text,
  1047. instead of starting a new entry.  With `C-M-w', you can kill several
  1048. separated pieces of text and accumulate them to be yanked back in one
  1049. place.
  1050.  
  1051. 
  1052. File: xemacs.info,  Node: Earlier Kills,  Prev: Appending Kills,  Up: Yanking
  1053.  
  1054. Yanking Earlier Kills
  1055. ---------------------
  1056.  
  1057.    To recover killed text that is no longer the most recent kill, you
  1058. need the `Meta-y' (`yank-pop') command.  You can use `M-y' only after a
  1059. `C-y' or another `M-y'.  It takes the text previously yanked and
  1060. replaces it with the text from an earlier kill.  To recover the text of
  1061. the next-to-the-last kill, first use `C-y' to recover the last kill,
  1062. then `M-y' to replace it with the previous kill.
  1063.  
  1064.    You can think in terms of a "last yank" pointer which points at an
  1065. item in the kill ring.  Each time you kill, the "last yank" pointer
  1066. moves to the new item at the front of the ring.  `C-y' yanks the item
  1067. which the "last yank" pointer points to.  `M-y' moves the "last yank"
  1068. pointer to a different item, and the text in the buffer changes to
  1069. match.  Enough `M-y' commands can move the pointer to any item in the
  1070. ring, so you can get any item into the buffer.  Eventually the pointer
  1071. reaches the end of the ring; the next `M-y' moves it to the first item
  1072. again.
  1073.  
  1074.    Yanking moves the "last yank" pointer around the ring, but does not
  1075. change the order of the entries in the ring, which always runs from the
  1076. most recent kill at the front to the oldest one still remembered.
  1077.  
  1078.    Use `M-y' with a numeric argument to advance the "last yank" pointer
  1079. by the specified number of items.  A negative argument moves the
  1080. pointer toward the front of the ring; from the front of the ring, it
  1081. moves to the last entry and starts moving forward from there.
  1082.  
  1083.    Once the text you are looking for is brought into the buffer, you can
  1084. stop doing `M-y' commands and the text will stay there. Since the text
  1085. is just a copy of the kill ring item, editing it in the buffer does not
  1086. change what's in the ring.  As long you don't kill additional text, the
  1087. "last yank" pointer remains at the same place in the kill ring:
  1088. repeating `C-y' will yank another copy of the same old kill.
  1089.  
  1090.    If you know how many `M-y' commands it would take to find the text
  1091. you want, you can yank that text in one step using `C-y' with a numeric
  1092. argument.  `C-y' with an argument greater than one restores the text
  1093. the specified number of entries back in the kill ring.  Thus, `C-u 2
  1094. C-y' gets the next to the last block of killed text.  It is equivalent
  1095. to `C-y M-y'.  `C-y' with a numeric argument starts counting from the
  1096. "last yank" pointer, and sets the "last yank" pointer to the entry that
  1097. it yanks.
  1098.  
  1099.    The variable `kill-ring-max' controls the length of the kill ring;
  1100. no more than that many blocks of killed text are saved.
  1101.  
  1102. 
  1103. File: xemacs.info,  Node: Using X Selections,  Next: Accumulating Text,  Prev: Yanking,  Up: Top
  1104.  
  1105. Using X Selections
  1106. ==================
  1107.  
  1108.    In the X window system, mouse selections provide a simple mechanism
  1109. for text transfer between different applications.  In a typical X
  1110. application, you can select text by pressing the left mouse button and
  1111. dragging the cursor over the text you want to copy.  The text becomes
  1112. the primary X selection and is highlighted.  The highlighted region is
  1113. also the Emacs selected region.
  1114.  
  1115.    * Since the region is the primary X selection, you can go to a
  1116.      different X application and click the middle mouse button: the
  1117.      text that you selected in the previous application is pasted into
  1118.      the current application.
  1119.  
  1120.    * Since the region is the Emacs selected region, you can use all
  1121.      region commands (`C-w, M-w' etc.) as well as the options of the
  1122.      Edit menu to manipulate the selected text.
  1123.  
  1124. * Menu:
  1125.  
  1126. * X Clipboard Selection::         Pasting to the X clipboard.
  1127. * X Selection Commands::    Other operations on the selection.
  1128. * X Cut Buffers::           X cut buffers are available for compatibility.
  1129. * Active Regions::          Using zmacs-style highlighting of the
  1130.                              selected region.
  1131.  
  1132. 
  1133. File: xemacs.info,  Node: X Clipboard Selection,  Next: X Selection Commands,  Prev: Using X Selections,  Up: Using X Selections
  1134.  
  1135. The Clipboard Selection
  1136. -----------------------
  1137.  
  1138.    There are other kinds of X selections besides the Primary selection;
  1139. one common one is the Clipboard selection.  Some applications prefer to
  1140. transfer data using this selection in preference to the Primary.  One
  1141. can transfer text from the Primary selection to the  Clipboard
  1142. selection with the Copy command under the Edit menu in the menubar.
  1143.  
  1144.    Usually, the clipboard selection is not visible.  However, if you
  1145. run the `xclipboard' application, the text most recently copied to the
  1146. clipboard (with the Copy command) is displayed in a window.  Any time
  1147. new text is thus copied, the `xclipboard' application makes a copy of
  1148. it and displays it in its window.  The value of the clipboard can
  1149. survive the lifetime of the running Emacs process.  The `xclipboard'
  1150. man page provides more details.
  1151.  
  1152.    Warning: If you use the `xclipboard' application, remember that it
  1153. maintains a list of all things that have been pasted to the clipboard
  1154. (that is, copied with the Copy command).  If you don't manually delete
  1155. elements from this list by clicking on the Delete button in the
  1156. `xclipboard' window, the clipboard will eventually consume a lot of
  1157. memory.
  1158.  
  1159.    In summary, some X applications (such as `xterm') allow one to paste
  1160. text in them from XEmacs in the following way:
  1161.  
  1162.    * Drag out a region of text in Emacs with the left mouse button,
  1163.      making that text be the Primary selection.
  1164.  
  1165.    * Click the middle button in the other application, pasting the
  1166.      Primary selection.
  1167.  
  1168.    With some other applications (notably, the OpenWindows and Motif
  1169. tools) you must use this method instead:
  1170.  
  1171.    * Drag out a region of text in Emacs with the left mouse button,
  1172.      making that text be the Primary selection.
  1173.  
  1174.    * Copy the selected text to the Clipboard selection by selecting the
  1175.      Copy menu item from the Edit menu, or by hitting the Copy key on
  1176.      your keyboard.
  1177.  
  1178.    * Paste the text in the other application by selecting Paste from its
  1179.      menu, or by hitting the Paste key on your keyboard.
  1180.  
  1181. 
  1182. File: xemacs.info,  Node: X Selection Commands,  Next: X Cut Buffers,  Prev: X Clipboard Selection,  Up: Using X Selections
  1183.  
  1184. Miscellaneous X Selection Commands
  1185. ----------------------------------
  1186.  
  1187. `M-x x-copy-primary-selection'
  1188.      Copy the primary selection to both the kill ring and the Clipboard.
  1189.  
  1190. `M-x x-insert-selection'
  1191.      Insert the current selection into the buffer at point.
  1192.  
  1193. `M-x x-delete-primary-selection'
  1194.      Deletes the text in the primary selection without copying it to
  1195.      the kill ring or the Clipboard.
  1196.  
  1197. `M-x x-kill-primary-selection'
  1198.      Deletes the text in the primary selection and copies it to both
  1199.      the kill ring and the Clipboard.
  1200.  
  1201. `M-x x-mouse-kill'
  1202.      Kill the text between point and the mouse and copy it to the
  1203.      clipboard and to the cut buffer.
  1204.  
  1205. `M-x x-own-secondary-selection'
  1206.      Make a secondary X selection of the given argument.
  1207.  
  1208. `M-x x-own-selection'
  1209.      Make a primary X selection of the given argument.
  1210.  
  1211. `M-x x-set-point-and-insert-selection'
  1212.      Set point where clicked and insert the primary selection or the
  1213.      cut buffer.
  1214.  
  1215. 
  1216. File: xemacs.info,  Node: X Cut Buffers,  Next: Active Regions,  Prev: X Selection Commands,  Up: Using X Selections
  1217.  
  1218. X Cut Buffers
  1219. -------------
  1220.  
  1221.    X cut buffers are a different, older way of transferring text between
  1222. applications.  XEmacs supports cut buffers for compatibility with older
  1223. programs, even though selections are now the preferred way of
  1224. transferring text.
  1225.  
  1226.    X has a concept of applications "owning" selections.  When you select
  1227. text by clicking and dragging inside an application, the application
  1228. tells the X server that it owns the selection.  When another
  1229. application asks the X server for the value of the selection, the X
  1230. server requests the information from the owner. When you use
  1231. selections, the selection data is not actually transferred unless
  1232. someone wants it; the act of making a selection doesn't transfer data.
  1233. Cut buffers are different: when you "own" a cut buffer, the data is
  1234. actually transferred to the X server immediately, and survives the
  1235. lifetime of the application.
  1236.  
  1237.    Any time a region of text becomes the primary selection in Emacs,
  1238. Emacs also copies that text to the cut buffer.  This makes it possible
  1239. to copy text from an XEmacs buffer and paste it into an older,
  1240. non-selection-based application (such as Emacs 18).
  1241.  
  1242.    Note: Older versions of Emacs could not access the X selections, only
  1243. the X cut buffers.
  1244.  
  1245.